<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>


<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>

<portlet:defineObjects />
<%
PortletPreferences prefs = renderRequest.getPreferences();
String error = renderRequest.getParameter("error");
String success = renderRequest.getParameter("success");

if(error!=null){ //if there are any error messages display here
    out.println("<div class=\"portlet-msg-error\">"+error.replace("+", " ")+"</div>");
}
if(success!=null){ // if there are any success messages display here
    out.println("<div class=\"portlet-msg-success\">"+success.replace("+", " ")+"</div>");
}
%>
<%-- anyway Display the form here--%>
<div class="portlet-form">
    <form action="<portlet:actionURL><portlet:param name="edit" value="edit"/></portlet:actionURL>" method="post">
        <table>
                   <tr>
                        <td><span class="portlet-form-label"><b>JIRA URL:</b></span></td>
                        <td><input class="portlet-form-input-field" type="text" name="formUrl" value="<%=prefs.getValue("jiraUrl", "") %>" /></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td><span class="portlet-form-label"><b>JIRA Login:</b></span></td>
                        <td><input class="portlet-form-input-field" type="text" name="formLogin" value="<%=prefs.getValue("jiraLogin", "") %>" /></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr><td colspan="3" align="right"><input class="portlet-form-button" type="submit" value="Save" /></td></tr>
        </table>
    </form>
</div>
<%-- Footer to link to JIRA --%>
<hr style="border-bottom: dotted 1px"/>
<div class="portlet-section-footer" >
    Go To: <a href="<%=prefs.getValue("jiraUrl", "null")%>" >JIRA</a>
</div>